New function to create an icon set from a pixbuf.
authorJonathan Blandford <jrb@redhat.com>
Tue, 20 Feb 2001 19:07:15 +0000 (19:07 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Tue, 20 Feb 2001 19:07:15 +0000 (19:07 +0000)
Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>

* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
function to create an icon set from a pixbuf.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkiconfactory.c
gtk/gtkiconfactory.h
gtk/gtkimage.c

index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 6f499f155d98e7406daae2fb49cf132299cf2001..435ace142c1d67fae76553dc2a93cce6b6690f0c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 20 12:16:12 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
+       function to create an icon set from a pixbuf.
+
 2001-02-20  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkcellrenderertext.[ch]:
index 56d2fccc27b7c10006748a423343891c9cf93280..07b5d5038c5357d79cc5835fe3500f4714b668fb 100644 (file)
@@ -673,6 +673,34 @@ gtk_icon_set_new (void)
   return icon_set;
 }
 
+/**
+ * gtk_icon_set_new_from_pixbuf:
+ * @pixbuf: a #GdkPixbuf
+ * 
+ * Creates a new #GtkIconSet seeded with @pixbuf.
+ * 
+ * Return value: a new #GtkIconSet
+ **/
+GtkIconSet *
+gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf)
+{
+  GtkIconSet *set;
+
+  GtkIconSource source = { NULL, NULL, 0, 0, NULL,
+                           TRUE, TRUE, TRUE };
+
+  g_return_val_if_fail (pixbuf != NULL, NULL);
+
+  set = gtk_icon_set_new ();
+
+  source.pixbuf = pixbuf;
+
+  gtk_icon_set_add_source (set, &source);
+  
+  return set;
+}
+
+
 /**
  * gtk_icon_set_ref:
  * @icon_set: a #GtkIconSet
index 23f605986566815366905d9e53220b2d2c6accf9..1f26abb823f285a2cfebc83ae7699a4362acdee6 100644 (file)
@@ -103,6 +103,7 @@ void     gtk_icon_size_register_alias (const gchar *alias,
 /* Icon sets */
 
 GtkIconSet* gtk_icon_set_new             (void);
+GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf       *pixbuf);
 
 GtkIconSet* gtk_icon_set_ref             (GtkIconSet      *icon_set);
 void        gtk_icon_set_unref           (GtkIconSet      *icon_set);
index 53ea859d38cce4393d014fefdf90e296d4542eb9..d82effbb77d9daf2e9ecf2280910e715a9138662 100644 (file)
@@ -191,6 +191,10 @@ gtk_image_new_from_file   (const gchar *filename)
  * pixbuf; you still need to unref it if you own references.
  * #GtkImage will add its own reference rather than adopting yours.
  * 
+ * Note that this function just creates an #GtkImage from the pixbuf.  The
+ * #GtkImage created will not react to state changes.  Should you want that, you
+ * should use @gtk_image_new_from_icon_set.
+ * 
  * Return value: a new #GtkImage
  **/
 GtkWidget*